<?php
require_once 'includes/haut.php';
require_once 'includes/donneesFormulaires.php';

$idCreation = (isset($_POST["idCreation"])) ? htmlentities($_POST["idCreation"]) : NULL;
$idClient = (isset($_POST["idClient"])) ? htmlentities($_POST["idClient"]) : NULL;
if($idCreation && $idClient) {
	$erreurs = "";
	$favori = new favori($idCreation, $idClient);
	$erreurs = $favori->getErreurs();
	if($favori->isValid()){
		$favori->ajoutBD();
		echo '1';
	}
	else echo $erreurs;
}
?>